#include <string.h>
#include <stdio.h>
#include <stdlib.h>
//#include "hash.c"

int main()
{

	//oldmain();

    char *inname = "texto";
    FILE *infile;
    char line_buffer[BUFSIZ]; /* BUFSIZ is defined if you include stdio.h */
    char line_number;
    
    
	char *histogram = "histogram";
	FILE *histogram_file;
	histogram_file = fopen(histogram, "r");
	if (!histogram_file) {
		printf("Couldn't open file %s for update.\n", histogram);
		return 0;
	}

    infile = fopen(inname, "r");
    if (!infile) {
        printf("Couldn't open file %s for reading.\n", inname);
        return 0;
    }
    printf("Opened file %s for reading.\n", inname);

    line_number = 0;
    
/* Prints infile with line numbers */
    while (fgets(line_buffer, sizeof(line_buffer), infile)) {
        ++line_number;
        /* note that the newline is in the buffer */
        printf("%4d: %s", line_number, line_buffer);
    }
    printf("\nTotal number of lines = %d\n", line_number);
    
    
    
    }
